package com.edu.zql;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by User on 2017/10/18.
 */
public class 中文二进制 {


    public static void main(String[] args) throws UnsupportedEncodingException {
        String s = "朱乾力";

        byte[] bytes = s.getBytes();
        String bb = "";
        for (byte b : bytes) {
            bb += Integer.toBinaryString(b);
        }


        byte[] bs = new byte[bb.length() / 32];

        for (int i = 0; i < bb.length() / 32; i++) {
            String substring = bb.substring(32 * i, 32 * i +32);
            byte b = Byte.parseByte(substring, 2);
            bs[i] = b;
        }
        System.out.println(new String(bs));

    }
}